This article describes how to define literal objects in json data format in PHP. This is a work und. json can also be used to generate arrays in classes, for more information, see
This article describes how to define literal objects in json data
This article mainly introduces thinkphp's use of literal to prevent template tags from being parsed. It is a very practical technique to achieve direct output of some template tags that do not need to be parsed, for more information, see
This
Thinkphp uses literal to prevent template labels from being parsed, thinkphpliteral
In this paper, we describe the method that thinkphp does not parse the direct output of the label to prevent the template label from being parsed. Share to everyone
In PHP, escape and inverse meanings of strings can also be implemented using the addslashes () and stripslashes () functions provided by PHP. In PHP, the escape and inverse meanings of strings can be implemented using the self-owned functions
Phper all know that PHP does not support literal volume, at least the current version is not supported. For example, in JS you can define object in this way
Copy Code code as follows:
var o = {' name ': ' QTTC ', ' url ': '
Currently, the literal naming method is not supported in PHP.The small partners at the front end know that the method of defining an object in JS with literal literals can be as follows:var o = {' name ': ' Tom ', ' url ': ' Www.baidu.com ' };alert (
The example of this article describes the method of thinkphp label direct output to prevent template tags from being parsed. Share to everyone for your reference. The implementation methods are as follows:
You can use the literal tag in thinkphp to
1,capture Label
Capture's Chinese meaning is crawl, its function is to crawl the data of the template output, when we need it, call it to get the purpose of fetching data. Example:
The code is as follows
Copy Code
PHP, a nested abbreviated name, is an abbreviation for the English Super Text preprocessing language (Php:hypertext preprocessor). PHP is an HTML embedded language, PHP and Microsoft's ASP quite a bit similar, is a server-side implementation of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.